<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>User Management</title>
<link type="text/css" href="JSP/css/style.css" rel="stylesheet"></link>
</head>

<%@include file="../checkSession.jsp"%>
<%@page import="model.UserInfo"%>
<%@page import="java.util.LinkedList"%>
<%!int m = 5;
	int n = 8;
	int[][] data = new int[m][n];
	LinkedList<UserInfo> list;%>
<%
	for (int i = 0; i < m; i++) {
		for (int j = 0; j < n; j++) {
			data[i][j] = j;
		}
	}
	String a;
	list = (LinkedList<UserInfo>) request.getAttribute("lstUser");
	if (list == null) {
		out.println("NULL");
	} else {
%>
<body>
	<div id="wrap">
		<%@include file="adminHeader.jsp"%>
		<font size="3" face="verdana" color="orange">Users Managements</font>
		<div class="center_content">
			<div class="right_content">
				<table border=1>
					<tr>
						<th>User</th>
						<th>Password</th>
						<th>Status</th>
						<th>Quota</th>
						<th>Role</th>
						<th>Profile</th>

					</tr>
					<%
						for (int i = 0; i < list.size(); i++) {
					%>
					<tr>
						<%
							UserInfo u = list.get(i);
						%>
						<td><%=u.username%></td>
						<td><%=u.password%></td>
						<td><%=u.status%></td>
						<td><%=u.quota%></td>
						<td><%=u.role%></td>
						<td><%=u.profile%></td>
						<td class="options-width"><a
							href="./ServletAlterUser?username=<%=u.username%>"> Edit</a></td>
							<%if(!u.role.equalsIgnoreCase("ADMIN_ROLE")) {%>
						<td class="options-width"><a
							href="./ServletDeleteUser?username=<%=u.username%>">Delete</a></td>
							<%} %>
					</tr>
					<%
					}
					}
				%>
				</table>
				<div id="create_new_user">
					<a href="/ASS_ISS/JSP/adminView/createUser.jsp">Create New User</a>
				</div>
				
			</div>
		</div>
	</div>
</body>
</html>